import moment from 'moment'
moment.locale('zh-cn')

export default function SubmitUser({user, time}) {
  const {nick, imgUrl} = user
  return <div style={{
    fontSize: '80%',
    color: '#AAA'
  }}>
    <img
      src={imgUrl}
      alt='avatar'
      style={{
        width: 22, height: 22, borderRadius: '50%',
        verticalAlign: 'bottom',
        objectFit: 'cover'
      }}
    />
      <span style={{paddingLeft: 4}}>{nick}</span>
      <span style={{paddingLeft: 4}}>
        {moment(time).fromNow()}
      </span>
    </div>
}